/*
    This file is part of AutoQuad.

    AutoQuad is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    AutoQuad is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with AutoQuad.  If not, see <http://www.gnu.org/licenses/>.

    Copyright © 2011, 2012  Bill Nesbitt
*/

#define DEFAULT_CONFIG_VERSION	    835

#define DEFAULT_RADIO_TYPE	    0		// 0 == Spektrum 11bit, 1 == Spektrum 10bit, 2 == Futaba, 3 == PWM

#define DEFAULT_CTRL_PID_TYPE	    0		// 0 == parallel TILT/RATE PIDs, 1 == cascading TILT/RATE PIDs

#define DEFAULT_CTRL_FACT_THRO	    0.70f	// user throttle multiplier
#define DEFAULT_CTRL_FACT_PITC	    0.05f	// user pitch multiplier
#define DEFAULT_CTRL_FACT_ROLL	    0.05f	// user roll multiplier
#define DEFAULT_CTRL_FACT_RUDD	    0.0005f	// user rudder multiplier
#define DEFAULT_CTRL_DEAD_BAND	    35.0f	// rc control dead band (for DVH & rudder control)
#define DEFAULT_CTRL_MIN_THROT	    35		// minimum user throttle to activate motors
#define DEFAULT_CTRL_MAX	    350		// maximum control applied to motors +- throttle
#define DEFAULT_CTRL_NAV_YAW_RT	    180.0f	// maximum navigation yaw rate deg/s

// TILT rate PID
#define DEFAULT_CTRL_TLT_RTE_P	    0.0f
#define DEFAULT_CTRL_TLT_RTE_I	    0.0f
#define DEFAULT_CTRL_TLT_RTE_D	    4882.0f
#define DEFAULT_CTRL_TLT_RTE_F	    0.25f
#define DEFAULT_CTRL_TLT_RTE_PM	    999.0f
#define DEFAULT_CTRL_TLT_RTE_IM	    999.0f
#define DEFAULT_CTRL_TLT_RTE_DM	    999.0f
#define DEFAULT_CTRL_TLT_RTE_OM	    325.0f

// YAW rate PID
#define DEFAULT_CTRL_YAW_RTE_P	    325.0f
#define DEFAULT_CTRL_YAW_RTE_I	    0.15f
#define DEFAULT_CTRL_YAW_RTE_D	    50.0f
#define DEFAULT_CTRL_YAW_RTE_F	    0.25f
#define DEFAULT_CTRL_YAW_RTE_PM	    175.0f
#define DEFAULT_CTRL_YAW_RTE_IM	    100.0f
#define DEFAULT_CTRL_YAW_RTE_DM	    80.0f
#define DEFAULT_CTRL_YAW_RTE_OM	    250.0f

// TILT angle PID
#define DEFAULT_CTRL_TLT_ANG_P	    40.0f
#define DEFAULT_CTRL_TLT_ANG_I	    0.0005f
#define DEFAULT_CTRL_TLT_ANG_D	    1185.0f
#define DEFAULT_CTRL_TLT_ANG_F	    0.25f
#define DEFAULT_CTRL_TLT_ANG_PM	    250.0f
#define DEFAULT_CTRL_TLT_ANG_IM	    100.0f
#define DEFAULT_CTRL_TLT_ANG_DM	    250.0f
#define DEFAULT_CTRL_TLT_ANG_OM	    325.0f

// YAW angle PID
#define DEFAULT_CTRL_YAW_ANG_P	    0.05f
#define DEFAULT_CTRL_YAW_ANG_I	    0.00002f
#define DEFAULT_CTRL_YAW_ANG_D	    0.0f
#define DEFAULT_CTRL_YAW_ANG_F	    0.0f
#define DEFAULT_CTRL_YAW_ANG_PM	    1.25f
#define DEFAULT_CTRL_YAW_ANG_IM	    0.04f
#define DEFAULT_CTRL_YAW_ANG_DM	    0.0f
#define DEFAULT_CTRL_YAW_ANG_OM	    1.25f

#define DEFAULT_GPS_BAUD_RATE	    230400
#define DEFAULT_GPS_RATE	    200		// ms per cycle (5Hz)

#define DEFAULT_MOT_FRAME	    0		// 0 == custom, 1 == '+' configuration, 2 == 'x', 3 == hex
#define DEFAULT_MOT_START	    1120
#define DEFAULT_MOT_MIN		    975
#define DEFAULT_MOT_MAX		    1950
#define DEFAULT_MOT_HOV_THROT	    500
#define DEFAULT_MOT_EXP_FACT	    0.0f
#define DEFAULT_MOT_EXP_MIN	    0.0f
#define DEFAULT_MOT_EXP_MAX	    0.0f

//	T      R      P	     Y	    PORT
//
//    100      0    100   -100      9
//    100    100     50    100     13
//    100    100    -50   -100      8
//    100      0   -100    100      1
//    100   -100    -50   -100      4
//    100   -100     50    100      2

#define DEFAULT_MOT_PWRD_01_T	    100.0
#define DEFAULT_MOT_PWRD_01_P	    -100.0
#define DEFAULT_MOT_PWRD_01_R	    0.0
#define DEFAULT_MOT_PWRD_01_Y	    100.0
#define DEFAULT_MOT_PWRD_02_T	    100.0
#define DEFAULT_MOT_PWRD_02_P	    50.0
#define DEFAULT_MOT_PWRD_02_R	    100.0
#define DEFAULT_MOT_PWRD_02_Y	    100.0
#define DEFAULT_MOT_PWRD_03_T	    0.0
#define DEFAULT_MOT_PWRD_03_P	    0.0
#define DEFAULT_MOT_PWRD_03_R	    0.0
#define DEFAULT_MOT_PWRD_03_Y	    0.0
#define DEFAULT_MOT_PWRD_04_T	    100.0
#define DEFAULT_MOT_PWRD_04_P	    -50.0
#define DEFAULT_MOT_PWRD_04_R	    100.0
#define DEFAULT_MOT_PWRD_04_Y	    -100.0
#define DEFAULT_MOT_PWRD_05_T	    0.0
#define DEFAULT_MOT_PWRD_05_P	    0.0
#define DEFAULT_MOT_PWRD_05_R	    0.0
#define DEFAULT_MOT_PWRD_05_Y	    0.0
#define DEFAULT_MOT_PWRD_06_T	    0.0
#define DEFAULT_MOT_PWRD_06_P	    0.0
#define DEFAULT_MOT_PWRD_06_R	    0.0
#define DEFAULT_MOT_PWRD_06_Y	    0.0
#define DEFAULT_MOT_PWRD_07_T	    0.0
#define DEFAULT_MOT_PWRD_07_P	    0.0
#define DEFAULT_MOT_PWRD_07_R	    0.0
#define DEFAULT_MOT_PWRD_07_Y	    0.0
#define DEFAULT_MOT_PWRD_08_T	    100.0
#define DEFAULT_MOT_PWRD_08_P	    -50.0
#define DEFAULT_MOT_PWRD_08_R	    -100.0
#define DEFAULT_MOT_PWRD_08_Y	    -100.0
#define DEFAULT_MOT_PWRD_09_T	    100.0
#define DEFAULT_MOT_PWRD_09_P	    100.0
#define DEFAULT_MOT_PWRD_09_R	    0.0
#define DEFAULT_MOT_PWRD_09_Y	    -100.0
#define DEFAULT_MOT_PWRD_10_T	    0.0
#define DEFAULT_MOT_PWRD_10_P	    0.0
#define DEFAULT_MOT_PWRD_10_R	    0.0
#define DEFAULT_MOT_PWRD_10_Y	    0.0
#define DEFAULT_MOT_PWRD_11_T	    0.0
#define DEFAULT_MOT_PWRD_11_P	    0.0
#define DEFAULT_MOT_PWRD_11_R	    0.0
#define DEFAULT_MOT_PWRD_11_Y	    0.0
#define DEFAULT_MOT_PWRD_12_T	    0.0
#define DEFAULT_MOT_PWRD_12_P	    0.0
#define DEFAULT_MOT_PWRD_12_R	    0.0
#define DEFAULT_MOT_PWRD_12_Y	    0.0
#define DEFAULT_MOT_PWRD_13_T	    100.0
#define DEFAULT_MOT_PWRD_13_P	    50.0
#define DEFAULT_MOT_PWRD_13_R	    -100.0
#define DEFAULT_MOT_PWRD_13_Y	    100.0
#define DEFAULT_MOT_PWRD_14_T	    0.0
#define DEFAULT_MOT_PWRD_14_P	    0.0
#define DEFAULT_MOT_PWRD_14_R	    0.0
#define DEFAULT_MOT_PWRD_14_Y	    0.0


#define DEFAULT_DOWNLINK_BAUD	    115200

#define DEFAULT_TELEMETRY_RATE	    20		// loops between reports

#define DEFAULT_NAV_MAX_SPEED	    5.0f	// in m/s

// speed => tilt PID
#define DEFAULT_NAV_SPEED_P	    7.0f
#define DEFAULT_NAV_SPEED_I	    0.005f
#define DEFAULT_NAV_SPEED_PM	    20.0f
#define DEFAULT_NAV_SPEED_IM	    20.0f
#define DEFAULT_NAV_SPEED_OM	    30.0f

// distance => speed PID
#define DEFAULT_NAV_DIST_P	    0.5f
#define DEFAULT_NAV_DIST_I	    0.0f
#define DEFAULT_NAV_DIST_PM	    999.0f
#define DEFAULT_NAV_DIST_IM	    0.0f
#define DEFAULT_NAV_DIST_OM	    999.0f

// Altitude hold Speed PID
#define DEFAULT_NAV_ATL_SPED_P	    200.0f
#define DEFAULT_NAV_ATL_SPED_I	    1.2f
#define DEFAULT_NAV_ATL_SPED_PM	    150.0f
#define DEFAULT_NAV_ATL_SPED_IM	    600.0f
#define DEFAULT_NAV_ATL_SPED_OM	    600.0f

// Altitude hold Position PID
#define DEFAULT_NAV_ALT_POS_P	    0.25f
#define DEFAULT_NAV_ALT_POS_I	    0.0f
#define DEFAULT_NAV_ALT_POS_PM	    2.0f
#define DEFAULT_NAV_ALT_POS_IM	    0.0f
#define DEFAULT_NAV_ALT_POS_OM	    2.0f

#define DEFAULT_IMU_ROT		    -45.0		// degrees to rotate the IMU to align with the frame


#define DEFAULT_IMU_ACC_BIAS1_X -6.320267392e-05
#define DEFAULT_IMU_ACC_BIAS1_Y -2.123780437e-04
#define DEFAULT_IMU_ACC_BIAS1_Z -1.869946436e-04
#define DEFAULT_IMU_ACC_BIAS2_X -4.198301044e-07
#define DEFAULT_IMU_ACC_BIAS2_Y -4.554340821e-07
#define DEFAULT_IMU_ACC_BIAS2_Z -5.941563861e-06
#define DEFAULT_IMU_ACC_BIAS3_X -3.988137293e-08
#define DEFAULT_IMU_ACC_BIAS3_Y -4.665480548e-08
#define DEFAULT_IMU_ACC_BIAS3_Z -1.423569219e-07
#define DEFAULT_IMU_ACC_SCAL1_X -1.995581879e-06
#define DEFAULT_IMU_ACC_SCAL1_Y -3.647906464e-06
#define DEFAULT_IMU_ACC_SCAL1_Z -3.089457452e-05
#define DEFAULT_IMU_ACC_SCAL2_X -1.929645347e-07
#define DEFAULT_IMU_ACC_SCAL2_Y -2.293888116e-07
#define DEFAULT_IMU_ACC_SCAL2_Z -1.630904204e-06
#define DEFAULT_IMU_ACC_SCAL3_X -2.429031392e-09
#define DEFAULT_IMU_ACC_SCAL3_Y -9.017391992e-10
#define DEFAULT_IMU_ACC_SCAL3_Z -1.951145576e-08

#define DEFAULT_IMU_ACC_BIAS_X          -1.639045451831 //  0.000000000094 +0.000000000118
#define DEFAULT_IMU_ACC_BIAS_Y          -1.645982093991 //  0.000000000100 -0.000000000123
#define DEFAULT_IMU_ACC_BIAS_Z          -1.646450654747 //  0.000000000100 +0.000000000084
#define DEFAULT_IMU_ACC_SCAL_X          +0.019380314133 //  0.000000000100 +0.000000000595
#define DEFAULT_IMU_ACC_SCAL_Y          +0.019743321212 //  0.000000000100 -0.000000000531
#define DEFAULT_IMU_ACC_SCAL_Z          +0.019713235245 //  0.000000000100 +0.000000000049
#define DEFAULT_IMU_ACC_ALGN_XY         +0.014811991123 //  0.000009999778 +0.000000012926
#define DEFAULT_IMU_ACC_ALGN_XZ         +0.009379580216 //  0.000009897458 +0.000000001821
#define DEFAULT_IMU_ACC_ALGN_YX         +0.010810722295 //  0.000009999084 -0.000000012985
#define DEFAULT_IMU_ACC_ALGN_YZ         +0.000877172289 //  0.000009999959 +0.000000008589
#define DEFAULT_IMU_ACC_ALGN_ZX         -0.000860775855 //  0.000009999972 -0.000000006886
#define DEFAULT_IMU_ACC_ALGN_ZY         -0.000225528723 //  0.000009999997 +0.000000000594


#define DEFAULT_IMU_MAG_BIAS1_X +4.721758325e-05
#define DEFAULT_IMU_MAG_BIAS1_Y +9.538229420e-06
#define DEFAULT_IMU_MAG_BIAS1_Z +1.091498573e-04
#define DEFAULT_IMU_MAG_BIAS2_X -3.879439622e-06
#define DEFAULT_IMU_MAG_BIAS2_Y +3.934708808e-06
#define DEFAULT_IMU_MAG_BIAS2_Z +7.056663449e-06
#define DEFAULT_IMU_MAG_BIAS3_X -6.117067677e-08
#define DEFAULT_IMU_MAG_BIAS3_Y +7.879704003e-08
#define DEFAULT_IMU_MAG_BIAS3_Z +1.280232897e-07
#define DEFAULT_IMU_MAG_SCAL1_X -6.585127718e-04
#define DEFAULT_IMU_MAG_SCAL1_Y +6.282835508e-04
#define DEFAULT_IMU_MAG_SCAL1_Z +6.627286181e-04
#define DEFAULT_IMU_MAG_SCAL2_X -3.786785341e-06
#define DEFAULT_IMU_MAG_SCAL2_Y +1.204379257e-06
#define DEFAULT_IMU_MAG_SCAL2_Z +3.321509751e-06
#define DEFAULT_IMU_MAG_SCAL3_X -9.756610046e-08
#define DEFAULT_IMU_MAG_SCAL3_Y +5.365474711e-08
#define DEFAULT_IMU_MAG_SCAL3_Z +8.997110093e-08


#define DEFAULT_IMU_MAG_BIAS_X          -0.018809486345 //  0.000000099939 +0.000000005078
#define DEFAULT_IMU_MAG_BIAS_Y          +0.017550346595 //  0.000000099962 +0.000000004630
#define DEFAULT_IMU_MAG_BIAS_Z          +0.011591201300 //  0.000000099706 +0.000000005666
#define DEFAULT_IMU_MAG_SCAL_X          +0.190435415409 //  0.000000099238 +0.000000000487
#define DEFAULT_IMU_MAG_SCAL_Y          -0.189688890946 //  0.000000078480 +0.000000001539
#define DEFAULT_IMU_MAG_SCAL_Z          -0.193580717926 //  0.000000080701 +0.000000001795
#define DEFAULT_IMU_MAG_ALGN_XY         -0.024729287558 //  0.000009986794 -0.000000003481
#define DEFAULT_IMU_MAG_ALGN_XZ         +0.027371222792 //  0.000009929758 +0.000000006229
#define DEFAULT_IMU_MAG_ALGN_YX         -0.005905007613 //  0.000009998611 +0.000000003098
#define DEFAULT_IMU_MAG_ALGN_YZ         +0.016908135206 //  0.000009990883 -0.000000044908
#define DEFAULT_IMU_MAG_ALGN_ZX         -0.022446915238 //  0.000009916353 +0.000000073137
#define DEFAULT_IMU_MAG_ALGN_ZY         -0.016885818712 //  0.000009997489 +0.000000017435

#define DEFAULT_IMU_GYO_BIAS_X -1.313927749e+00
#define DEFAULT_IMU_GYO_BIAS_Y -1.336517812e+00
#define DEFAULT_IMU_GYO_BIAS_Z -1.321504817e+00
#define DEFAULT_IMU_GYO_BIAS1_X +5.442263108e-04
#define DEFAULT_IMU_GYO_BIAS1_Y -9.266243413e-05
#define DEFAULT_IMU_GYO_BIAS1_Z +1.263444900e-04
#define DEFAULT_IMU_GYO_BIAS2_X -1.296050659e-06
#define DEFAULT_IMU_GYO_BIAS2_Y -1.867952589e-07
#define DEFAULT_IMU_GYO_BIAS2_Z +1.274927638e-06
#define DEFAULT_IMU_GYO_BIAS3_X +2.820944937e-09
#define DEFAULT_IMU_GYO_BIAS3_Y -1.551088484e-09
#define DEFAULT_IMU_GYO_BIAS3_Z +8.946772029e-09

#define DEFAULT_IMU_GYO_SCAL_X          +0.111640821615 //  0.000000099906 +0.000000000832
#define DEFAULT_IMU_GYO_SCAL_Y          +0.111475253504 //  0.000000100000 -0.000000000948
#define DEFAULT_IMU_GYO_SCAL_Z          +0.109334679330 //  0.000000099996 +0.000000000295
#define DEFAULT_IMU_GYO_ALGN_XY         -0.020344490624 //  0.000099815518 +0.000000006019
#define DEFAULT_IMU_GYO_ALGN_XZ         +0.008247998760 //  0.000099997906 -0.000000019697
#define DEFAULT_IMU_GYO_ALGN_YX         +0.008962227255 //  0.000099996153 -0.000000012619
#define DEFAULT_IMU_GYO_ALGN_YZ         -0.025431566039 //  0.000099910581 +0.000000002755
#define DEFAULT_IMU_GYO_ALGN_ZX         -0.021382673395 //  0.000099940129 -0.000000005981
#define DEFAULT_IMU_GYO_ALGN_ZY         -0.014103874515 //  0.000099981005 -0.000000001504


#define DEFAULT_GMBL_PWM_MAX	    2250
#define DEFAULT_GMBL_PWM_MIN	    750
#define DEFAULT_GMBL_NTRL_PITCH	    1575
#define DEFAULT_GMBL_NTRL_ROLL	    1442
#define DEFAULT_GMBL_SCAL_PITCH	    (1.0f / 91.0f)
#define DEFAULT_GMBL_SCAL_ROLL	    (1.0f / 70.0f)
#define DEFAULT_GMBL_SLEW_RATE	    0.005f

#define DEFAULT_SPVR_LOW_BAT1	    3.5f	// cell volts
#define DEFAULT_SPVR_LOW_BAT2	    3.3f	// cell volts

/*
#define DEFAULT_UKF_VEL_Q		+6.9861e-06	// +0.000006986094	 0.000008284630 -0.000000178158
#define DEFAULT_UKF_VEL_ALT_Q		+1.4079e-05	// +0.000014079267	 0.000009791544 -0.000000088476
#define DEFAULT_UKF_POS_Q		+7.6956e+01	// +76.956013758078	 0.000005515702 +3.5221585142992
#define DEFAULT_UKF_POS_ALT_Q		+6.5830e+01	// +65.829689379671	 0.000009513413 -1.4045588290347
#define DEFAULT_UKF_ACC_BIAS_Q		+1.2705e-07	// +0.000000127053	 0.000009825083 +0.000000000613
#define DEFAULT_UKF_GYO_BIAS_Q		+5.0717e-06	// +0.000005071742	 0.000008777417 +0.000000060373
#define DEFAULT_UKF_QUAT_Q		+7.6126e-08	// +0.000000076126	 0.000008268599 +0.000000000006
#define DEFAULT_UKF_PRES_ALT_Q		+8.1440e-01	// +0.814400664958	 0.000009387677 -0.012213459714
#define DEFAULT_UKF_ACC_BIAS_V		+2.3980e-11	// +0.000000000024	 0.000010723092 -0.000000000000
#define DEFAULT_UKF_GYO_BIAS_V		+2.0645e-11	// +0.000000000021	 0.000010170254 -0.000000000001
#define DEFAULT_UKF_RATE_V		+4.1262e-09	// +0.000000004126	 0.000009352056 +0.000000000015
#define DEFAULT_UKF_PRES_ALT_V		+1.0294e-08	// +0.000000010294	 0.000009467923 -0.000000000078
#define DEFAULT_UKF_POS_V		+8.4432e-11	// +0.000000000084	 0.000009020525 +0.000000000000
#define DEFAULT_UKF_VEL_V		+1.6034e-11	// +0.000000000016	 0.000009871527 +0.000000000000
#define DEFAULT_UKF_ALT_POS_V		+6.1930e-13	// +0.000000000001	 0.000009246523 +0.000000000000
#define DEFAULT_UKF_ALT_VEL_V		+2.3861e-11	// +0.000000000024	 0.000009536499 +0.000000000000
#define DEFAULT_UKF_GPS_POS_N		+1.9786e-09	// +0.000000001979	 0.000007676041 -0.000000000017
#define DEFAULT_UKF_GPS_POS_M_N		+2.5346e-09	// +0.000000002535	 0.000009306523 +0.000000000080
#define DEFAULT_UKF_GPS_ALT_N		+1.9611e-08	// +0.000000019611	 0.000009352814 +0.000000000019
#define DEFAULT_UKF_GPS_ALT_M_N		+4.3243e-09	// +0.000000004324	 0.000007293794 -0.000000000028
#define DEFAULT_UKF_GPS_VEL_N		+5.9760e-06	// +0.000005976030	 0.000007947240 +0.000000041466
#define DEFAULT_UKF_GPS_VEL_M_N		+1.1956e-06	// +0.000001195557	 0.000009054273 -0.000000022516
#define DEFAULT_UKF_GPS_VD_N		+2.9347e-04	// +0.000293474575	 0.000009384798 +0.000001451206
#define DEFAULT_UKF_GPS_VD_M_N		+1.4114e-06	// +0.000001411353	 0.000009660760 +0.000000006032
#define DEFAULT_UKF_ALT_N		+2.2497e-05	// +0.000022496581	 0.000009060313 -0.000000068717
#define DEFAULT_UKF_ACC_N		+5.7378e-09	// +0.000000005738	 0.000008727542 +0.000000000186
#define DEFAULT_UKF_DIST_N		+4.0505e-06	// +0.000004050474	 0.000009163209 -0.000000018100
#define DEFAULT_UKF_MAG_N		+3.9315e-05	// +0.000039315467	 0.000008921520 -0.000000161858
#define DEFAULT_UKF_POS_DELAY		+2.0121e+03	// +2012.129621782368	 0.000099227182 +47.67786158114690
#define DEFAULT_UKF_VEL_DELAY		-1.0808e+05	// -108083.965722650159	 0.000009969907 +154.195266188661200
*/

#define DEFAULT_UKF_VEL_Q		+7.0274e-06	// +0.000007027374	 0.000059171675 +0.000000008439
#define DEFAULT_UKF_VEL_ALT_Q		+1.4267e-05	// +0.000014267482	 0.000053419357 -0.000000083178
#define DEFAULT_UKF_POS_Q		+8.1304e+01	// +81.304499064655	 0.000129024994 -0.1151222204102
#define DEFAULT_UKF_POS_ALT_Q		+5.7861e+01	// +57.860791090965	 0.000060654617 +0.0655449347963
#define DEFAULT_UKF_ACC_BIAS_Q		+1.0737e-07	// +0.000000107372	 0.000082985521 +0.000000000130
#define DEFAULT_UKF_GYO_BIAS_Q		+5.2749e-06	// +0.000005274881	 0.000060336975 -0.000000099760
#define DEFAULT_UKF_QUAT_Q		+6.9817e-08	// +0.000000069817	 0.000074083208 -0.000000000706
#define DEFAULT_UKF_PRES_ALT_Q		+8.3525e-01	// +0.835246299178	 0.000090838787 +0.008684256951
#define DEFAULT_UKF_ACC_BIAS_V		+2.7934e-11	// +0.000000000028	 0.000066829993 -0.000000000000
#define DEFAULT_UKF_GYO_BIAS_V		+2.1859e-11	// +0.000000000022	 0.000066577945 -0.000000000000
#define DEFAULT_UKF_RATE_V		+4.4932e-09	// +0.000000004493	 0.000056895463 -0.000000000015
#define DEFAULT_UKF_PRES_ALT_V		+1.0083e-08	// +0.000000010083	 0.000062546409 -0.000000000127
#define DEFAULT_UKF_POS_V		+7.4191e-11	// +0.000000000074	 0.000084990228 -0.000000000001
#define DEFAULT_UKF_VEL_V		+1.5046e-11	// +0.000000000015	 0.000058543576 -0.000000000000
#define DEFAULT_UKF_ALT_POS_V		+6.2789e-13	// +0.000000000001	 0.000072727157 +0.000000000000
#define DEFAULT_UKF_ALT_VEL_V		+2.2566e-11	// +0.000000000023	 0.000057059058 +0.000000000000
#define DEFAULT_UKF_GPS_POS_N		+2.0255e-09	// +0.000000002025	 0.000071450100 -0.000000000017
#define DEFAULT_UKF_GPS_POS_M_N		+2.3743e-09	// +0.000000002374	 0.000060202411 +0.000000000009
#define DEFAULT_UKF_GPS_ALT_N		+1.9359e-08	// +0.000000019359	 0.000055028679 -0.000000000773
#define DEFAULT_UKF_GPS_ALT_M_N		+4.9039e-09	// +0.000000004904	 0.000081882243 -0.000000000019
#define DEFAULT_UKF_GPS_VEL_N		+5.1067e-06	// +0.000005106734	 0.000064497869 +0.000000028292
#define DEFAULT_UKF_GPS_VEL_M_N		+1.3300e-06	// +0.000001330016	 0.000080639871 +0.000000001857
#define DEFAULT_UKF_GPS_VD_N		+2.9431e-04	// +0.000294313197	 0.000068572195 -0.000001641186
#define DEFAULT_UKF_GPS_VD_M_N		+1.3810e-06	// +0.000001381031	 0.000055266695 -0.000000000215
#define DEFAULT_UKF_ALT_N		+2.3208e-05	// +0.000023208299	 0.000052473983 +0.000000206891
#define DEFAULT_UKF_ACC_N		+5.1891e-09	// +0.000000005189	 0.000045604507 +0.000000000006
#define DEFAULT_UKF_DIST_N		+4.2836e-06	// +0.000004283598	 0.000055777771 +0.000000028306
#define DEFAULT_UKF_MAG_N		+3.5489e-05	// +0.000035489432	 0.000076321954 -0.000000255094
#define DEFAULT_UKF_POS_DELAY		+2.2903e+03	// +2290.324818556970	 0.000984855180 +23.83025505955790
#define DEFAULT_UKF_VEL_DELAY		-1.0340e+05	// -103402.174209119534	 0.000068990420 -110.450437893582500

#define DEFAULT_VN100_MAG_BIAS_X		-1.527519836146	//  0.000000751208 +0.000000032383
#define DEFAULT_VN100_MAG_BIAS_Y		+0.908526206596	//  0.000000995381 -0.000000037749
#define DEFAULT_VN100_MAG_BIAS_Z		-0.488330244089	//  0.000000999782 -0.000000165051
#define DEFAULT_VN100_MAG_SCAL_X		+1.264171211008	//  0.000000999158 -0.000000073758
#define DEFAULT_VN100_MAG_SCAL_Y		+1.288385132136	//  0.000000990606 +0.000000017356
#define DEFAULT_VN100_MAG_SCAL_Z		+1.677997848052	//  0.000000979568 -0.000000014816
#define DEFAULT_VN100_MAG_ALGN_XY		-0.014417940381	//  0.000099819444 -0.000000314891
#define DEFAULT_VN100_MAG_ALGN_XZ		-0.048863069782	//  0.000098983595 +0.000000165208
#define DEFAULT_VN100_MAG_ALGN_YX		+0.001245769431	//  0.000099996502 -0.000000022500
#define DEFAULT_VN100_MAG_ALGN_YZ		-0.006090249071	//  0.000099998189 -0.000000006316
#define DEFAULT_VN100_MAG_ALGN_ZX		-0.053313118936	//  0.000097899930 +0.000000031649
#define DEFAULT_VN100_MAG_ALGN_ZY		-0.173046065088	//  0.000099747323 -0.000000001900

#define DEFAULT_IMU_MAG_INCL            -67.147234696313        //  0.000000010000 +0.0000000043331
#define DEFAULT_IMU_MAG_DECL	    -10.11f